#ifndef IPSETTINGDIALOG_H
#define IPSETTINGDIALOG_H

#include <QDialog>
#include <QLineEdit>

namespace Ui {
class IpSettingDialog;
}

class IpSettingDialog : public QDialog
{
    Q_OBJECT

public:

    /**
     * @brief updateView　更新数据到界面控件上
     */
    void updateView();
    /**
     * @brief getInput　获取界面控件输入数据
     */
    void getInput();

public:
    /**
     * @brief hmiIp         示教器IP 网关 DNS
     */
    QVector<int> hmiIp;
    QVector<int> hmiGateway;
    QVector<int> hmiDNS;

    /**
     * @brief controllerIp  控制器IP 网关 DNS
     */
    QVector<int> controllerIp;
    QVector<int> controllerGateway;
    QVector<int> controllerDNS;

    QVector<QLineEdit *> hmiIpLine;
    QVector<QLineEdit *> hmiGatewayLine;
    QVector<QLineEdit *> hmiDNSLine;
    QVector<QLineEdit *> controllerIpLine;
    QVector<QLineEdit *> controllerGatewayLine;
    QVector<QLineEdit *> controllerDNSLine;

    bool initReadFileFlag;


signals:
    /**
     * @brief setHmiIp　设置示教器IP
     * @param hmiIp　示教器IP
     */
    void setHmiIp(QVector<int> hmiIp,QVector<int> hmiGateway,QVector<int> hmiDNS);
    /**
     * @brief setControllerIp　设置控制器IP
     * @param controllerIp　控制器IP
     */
    void setControllerIp(QVector<int> controllerIp,QVector<int> controllerGateway,QVector<int> controllerDNS);

public:
    explicit IpSettingDialog(int styleId,QWidget *parent = 0);
    ~IpSettingDialog();

    void initReadFileHmi(QString ip,QString gateway,QString dns);
    void initReadFileCtrl(QString ip,QString gateway,QString dns);

    void changeLanguage();

    void initialDisplayStyle(int styleId);

private slots:
    /**
     * @brief on_modifyHmi_Btn_clicked　设置示教器IP响应槽函数
     */
    void on_modifyHmi_Btn_clicked();
    /**
     * @brief on_modifyController_Btn_clicked　设置控制器IP响应槽函数
     */
    void on_modifyController_Btn_clicked();

    void on_returnBtn_clicked();

private:
    Ui::IpSettingDialog *ui;
};

#endif // IPSETTINGDIALOG_H
